home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 4.2 KB | 143 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWLink.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWLINK_H
- #define FWLINK_H
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- #ifndef FWTCOLL_H
- #include "FWTColl.h"
- #endif
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- #ifndef FWORDCOL_H
- #include "FWOrdCol.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class ODShape;
- class ODFacet;
-
- class FW_CFacetContext;
- class FW_CFrame;
- class FW_CMouseEvent;
- class FW_CPart;
- class FW_CPresentation;
- class FW_CGraphicContext;
-
- union FW_BitPattern;
-
- //=======================================================================================
- // Constants
- //=======================================================================================
-
- #define FW_kLinkBorderWidth 4
-
- extern const FW_BitPattern FW_kHLinkPat;
- extern const FW_BitPattern FW_kVLinkPat;
- extern const FW_BitPattern FW_kSelectedHLinkPat;
- extern const FW_BitPattern FW_kSelectedVLinkPat;
-
- // Current version of persistent links
- #define FW_kLinkVersionNumber 1
-
- //========================================================================================
- // class FW_CLink
- //========================================================================================
-
- class FW_CLink
- {
- public:
- FW_CLink(Environment* ev, FW_CPresentation* presentation);
- virtual ~ FW_CLink();
-
- //----------------------------------------------------------------------------------------
- // API
- //
- public:
- virtual ODShape* DoCreateLinkBorderShape(Environment* ev);
- virtual void DoDrawLinkBorder(Environment* ev, ODShape* outline, FW_CGraphicContext& gc);
-
- void InvalidateBorder(Environment* ev);
- FW_Boolean IsMouseInBorder(Environment* ev, FW_CFrame* frame, const FW_CMouseEvent& theMouseEvent);
-
- FW_Boolean IsBorderShown(Environment* ev) const;
- FW_Boolean IsLinkSelected(Environment* ev) const;
- void Select(Environment* ev, FW_Boolean newState);
-
- void SetSelectState(Environment* ev, FW_Boolean state);
- void SetShowBorder(Environment* ev, FW_Boolean showBorder);
-
- void ShowHideLinkBorder(Environment* ev, FW_Boolean turnOn, ODFacet* facet);
-
- private:
- void PrivDrawLinkBorder(Environment* ev, ODFacet* facet);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- FW_CPresentation* fPresentation;
-
- private:
- FW_Boolean fSelected;
- FW_Boolean fShowBorder; // Is the link border turned on?
- };
-
- //========================================================================================
- // FW_CLink Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CLink::IsBorderShown
- //----------------------------------------------------------------------------------------
- inline FW_Boolean FW_CLink::IsBorderShown(Environment*) const
- {
- return fShowBorder;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CLink::SetShowBorder
- //----------------------------------------------------------------------------------------
- inline void FW_CLink::SetShowBorder(Environment*, FW_Boolean showBorder)
- {
- fShowBorder = showBorder;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CLink::IsLinkSelected
- //----------------------------------------------------------------------------------------
- inline FW_Boolean FW_CLink::IsLinkSelected(Environment*) const
- {
- return fSelected;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CLink::SetSelectState
- //----------------------------------------------------------------------------------------
- inline void FW_CLink::SetSelectState(Environment*, FW_Boolean state)
- {
- fSelected = state;
- }
-
- #endif
-